<template>
    <div id='main' class="style">
    </div>
</template>

<script>
    import jsonp from 'jsonp'
    import echarts from 'echarts'
    import option from '../../util/epidemic_situation_option.js'
    import 'echarts/map/js/china'//导入地图
    export default {
        data() {
            return {
                provinceList: [],
            }
        },
        mounted() {
            /* jsonp(url,回调函数); */
            jsonp('https://interface.sina.cn/news/wap/fymap2020_data.d.json', (error, responseData) => {
                console.log(responseData);
                this.provinceList = responseData.data.list;
                this.tim = responseData.data.times
                option.series[0].data = this.provinceList.map(
                    p => {
                        return {name: p.name, value: p.econNum}
                    }
                )
                echarts.init(this.$el).setOption(option);
            });

        }

    }
</script>

<style>
    .style {
        width: 850px;
        height: 500px;
        display: flex;
        margin: 0 auto;
    }
</style>
